package xyz.gpgl.erp.logic.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import common.util.base.CommonUtil;
import common.util.mybatis.plus.layui.Page;
import common.util.mybatis.plus.logic.LogicBaseServiceImpl;
import org.springframework.stereotype.Service;
import xyz.gpgl.erp.logic.entity.LogicEmailInfo;
import xyz.gpgl.erp.logic.mapper.LogicEmailInfoMapper;
import xyz.gpgl.erp.logic.service.ILogicEmailInfoService;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author liubo
 * @since 2021-04-21
 */
@Service
public class LogicEmailInfoServiceImpl extends LogicBaseServiceImpl<LogicEmailInfoMapper, LogicEmailInfo> implements ILogicEmailInfoService {

    @Override
    public Page<LogicEmailInfo> notChecklistData(Integer sharesId, Page<LogicEmailInfo> page) {
        QueryWrapper<LogicEmailInfo> query= new QueryWrapper<>();
        query.apply(CommonUtil.isNotEmpty(sharesId),
                "id not in (select email_id from logic_shares_email where removed =0 and shares_id= {0})",sharesId);
        return this.page(page,query);
    }
}
